package chinese.constant.enums;

public enum ChnArticleStatusEnum {
	UNCHECKED("待审核", "初次提交", 0),
	UPDATED("待二次审核", "再次提交",1),
	ALLOWED("通过", "审核通过", 2),
	DISALLOWED("请修改", "审核不通过", 3),
	REJECTED("退稿", "退稿",4);
	
	// 成员变量
	private String userState;
    private String name;
    private int value;

    // 构造方法
    private ChnArticleStatusEnum(String userState, String name, int value){
    	this.userState = userState;
        this.name = name;
        this.value = value;
    }

    // 普通方法
    public static String getUserState(int value){
        for (ChnArticleStatusEnum e : ChnArticleStatusEnum.values()) {
            if (e.getValue() == value) {
                return e.getUserState();
            }
        }
        return null;
    }
    
    public static String getName(int value){
        for (ChnArticleStatusEnum e : ChnArticleStatusEnum.values()) {
            if (e.getValue() == value) {
                return e.getName();
            }
        }
        return null;
    }

    public String getUserState(){
		return userState;
	}
    
	public String getName(){
		return name;
	}

	public int getValue(){
		return value;
	}
}
